<?php
/**
 * Created by sublime 3.
 * Auth: Inhere
 * Date: 14-6-28
 * Time: 10:35
 * Uesd: 主要功能是 hi
 */
namespace ulue\libs\front;

class Front
{
	static public $instance = null;

  public function owner()
  {
      if (is_null($instance)) {
          self::$instance = new self;
      }
      return self::$instance;
  }

  /**
  * Display a var dump in firebug console
  *
  * @param object $object Object to display
  */
  static public function fd($object, $type = 'log')
  {
      $types = array('log', 'debug', 'info', 'warn', 'error', 'assert');

      if (!in_array($type, $types))
          $type = 'log';

      echo '
          <script type="text/javascript">
              console.'.$type.'('.self::jsonEncode($object).');
          </script>
      ';
  }

}